package com.sport.coaches.service.impl;

import java.util.List;
import com.sport.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sport.coaches.mapper.CoachesMapper;
import com.sport.coaches.domain.Coaches;
import com.sport.coaches.service.ICoachesService;

/**
 * 教练管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-06
 */
@Service
public class CoachesServiceImpl implements ICoachesService 
{
    @Autowired
    private CoachesMapper coachesMapper;

    /**
     * 查询教练管理
     * 
     * @param id 教练管理主键
     * @return 教练管理
     */
    @Override
    public Coaches selectCoachesById(Long id)
    {
        return coachesMapper.selectCoachesById(id);
    }

    /**
     * 查询教练管理列表
     * 
     * @param coaches 教练管理
     * @return 教练管理
     */
    @Override
    public List<Coaches> selectCoachesList(Coaches coaches)
    {
        return coachesMapper.selectCoachesList(coaches);
    }

    /**
     * 新增教练管理
     * 
     * @param coaches 教练管理
     * @return 结果
     */
    @Override
    public int insertCoaches(Coaches coaches)
    {
        coaches.setCreateTime(DateUtils.getNowDate());
        return coachesMapper.insertCoaches(coaches);
    }

    /**
     * 修改教练管理
     * 
     * @param coaches 教练管理
     * @return 结果
     */
    @Override
    public int updateCoaches(Coaches coaches)
    {
        coaches.setUpdateTime(DateUtils.getNowDate());
        return coachesMapper.updateCoaches(coaches);
    }

    /**
     * 批量删除教练管理
     * 
     * @param ids 需要删除的教练管理主键
     * @return 结果
     */
    @Override
    public int deleteCoachesByIds(Long[] ids)
    {
        return coachesMapper.deleteCoachesByIds(ids);
    }

    /**
     * 删除教练管理信息
     * 
     * @param id 教练管理主键
     * @return 结果
     */
    @Override
    public int deleteCoachesById(Long id)
    {
        return coachesMapper.deleteCoachesById(id);
    }
}
